//
//  TTButton.m
//  weappios
//
//  Created by mac on 2019/7/13.
//  Copyright © 2019 XiGuangLu. All rights reserved.
//

#import "TTButton.h"

@implementation TTButton


-(void)addTapBlock:(void(^)(UIButton *btn))block {
    self.block= block;
    [self addTarget:self action:@selector(click:) forControlEvents:UIControlEventTouchUpInside];
    
}

-(void)click:(UIButton*)btn
{
    if(self.block) {
        
        self.block(btn);
        
    }
}
-(void)setBlock:(void(^)(UIButton*))block{
    _block= block;
    [self addTarget:self action:@selector(click:) forControlEvents:UIControlEventTouchUpInside];
}


@end
